package org.aiforum.backend.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 页面跳转控制器
 * @author JAVA
 *
 */
@Controller// 该注解表示该类是springmvc控制器
public class PageForwordController {
	
	//Dir表示目录
	//pageName表示页面名称
	@RequestMapping("/{dir}/{pageName}")
	public String forwordDir(@PathVariable String dir,@PathVariable String pageName){
		return dir+"/"+pageName;
	}
	
	
	
	// 访问 http://localhost:8082/backend/index 那么pageName值为index
	// 访问 http://localhost:8082/backend/login 那么pageName值为login
	@RequestMapping("/{pageName}")
	public String forword(@PathVariable String pageName){
		System.out.println("------->" + pageName);
		return pageName;
	}

}
